/**
*		@file Next.h
*		@brief Next class
*
*		@author Lan Ziquan
*
*		@date 2/11/2012
*/

#ifndef NEXT_H
#define NEXT_H

#include "StmtTable.h"
#include "ProcTable.h"
#include "Parent.h"
#include "GNode.h"
#include <vector>

class Next{
public:
	static void		RebuildNext();

	static void		CompleteNext();

	static StmtSet&	GetNextRight(StmtNum stmt_num_left);
	static StmtSet& GetNextLeft(StmtNum stmt_num_right);

	static bool		IsNext(StmtNum stmt_num_left, StmtNum stmt_num_right);
	static bool		IsNextAdv(StmtNum stmt_num_left, StmtNum stmt_num_right);

private:
	static bool		ReadAndReturnNextAdv(StmtNum stmt_num_left, StmtNum stmt_num_right, bool& b_read_in);
	static bool		WriteAndReturnNextAdv(StmtNum stmt_num_left, StmtNum stmt_num_right, bool b_set_to);

	static vector<StmtSet>	next_table_;
	static vector<StmtSet>	next_table_t_;
	static vector<StmtSet>	next_adv_table_;
	static vector<StmtSet>	next_adv_cache_table_;

	static StmtSet			next_has_s0_;
	static StmtSet			next_has_0s_;
	static bool				next_has_00_;
};

#endif